<?php
//
defined('BY_JYA') or exit('error');
$return['ischecklogin']=cfc('core')->checklogin('','',true);
$return['member']=pdo_get('core_members',array('id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),array('credit1','credit2','mobile','paycode','paycodetime','avatar','nickname'));
if($return['member']['paycodetime']<time()-300){
	do{
		$paycode=rand(100000000000,999999999999);
		$check=pdo_getcolumn('core_members',array('paycode'=>$paycode,'uniacid'=>$_SESSION['uniacid']),'id');
	}while($check);
	pdo_update('core_members',array('paycode'=>$paycode,'paycodetime'=>time()),array('id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	$return['member']['paycode']=$paycode;
}
$return['qrcode']=cfc('tools')->createqrcode($return['member']['paycode'],'320',true);
$return['qrcode']=tomedia($return['qrcode']);
$return['item']=$item;
$return['sharedata']=array(
	'title'=>'我的付款码',
	'desc'=>'请提供二维码给店员扫码即可进行支付',
	'link'=>custom_url('core/member.paycode/',true),
	'imgUrl'=>tomedia($return['member']['avatar']),
);
set_html('title','我的付款码');
exi($return);
?>